		<div class="row">
		    <div class="col-xs-12">
		        <div class="box box-primary">
		            <div class="box-header">
		                <h3 class="box-title">Edit Data Obat</h3>
		            </div><!-- /.box-header -->
		            <?php echo form_open('obat/update', array('role' => 'form', 'id' => 'form'));
		            if(!empty($list)){
		            ?>
		            <div class="box-body">				        
	                    <!-- text input -->
	                    <div class="form-group">
		                    <label>Kategori</label>
		                    <?php 
		                        if ($list['kategori']=="Obat") {
		                            echo '&nbsp;&nbsp;<input type="radio" name="kat" value="Obat" checked="">Obat';
		                            echo '&nbsp;&nbsp;<input type="radio" name="kat" value="ABHP">ABHP';
		                        }else{
		                           	echo '&nbsp;&nbsp;<input type="radio" name="kat" value="Obat">Obat';
		                            echo '&nbsp;&nbsp;<input type="radio" name="kat" value="ABHP" checked="">ABHP';
		                        }
		                    ?>
		                </div> 
	                    <div class="form-group">
	                        <label>Kode Obat</label>
	                        <input type="hidden" name="id" value="<?= $list['kd_obat']?>">
	                        <input type="hidden" name="kd_ppk" value="<?= $list['KDPPK']?>">
	                       	<input class="form-control input-sm" name="kd_obat" value="<?= $list['kd_obat']?>" type="text" placeholder="Kode obat">
	                    </div>
	                    <div class="form-group">
	                        <label>Obat</label>
	                       	<input class="form-control input-sm" name="obat" value="<?= $list['obat']?>" type="text" placeholder="Nama obat">
	             
	                    </div>
	                    <div class="form-group">
	                        <label>Jenis Obat</label>
	                       	<select class="form-control input-sm" name="jenis_obat">
	                       		<?php 
	                       			foreach ($jenis_obat as $value) { 
	                       				if ($value['kd_jenis_obat']!=$list['KDJO']) {
			                                continue;
			                            }
			                            echo '<option value="'.$value['kd_jenis_obat'].'">'.$value['jenis_obat'].'</option>';

	                       			}
	                       		?>
	                       		<?php 
	                       			foreach ($jenis_obat as $value) { 
	                       				if ($value['kd_jenis_obat']==$list['KDJO']) {
			                                continue;
			                            }
			                            echo '<option value="'.$value['kd_jenis_obat'].'">'.$value['jenis_obat'].'</option>';

	                       			}
	                       		?>
	                       	</select>

	                    </div>
	                    <div class="form-group">
	                        <label>Harga</label>
	                       	<input class="form-control input-sm" name="harga" value="<?= $list['harga']?>" type="text" placeholder="Harga obat">
	             
	                    </div>
	                    <div class="form-group">
	                        <label>Satuan</label>
	                       	<input class="form-control input-sm" name="satuan" value="<?= $list['satuan']?>" type="text" placeholder="Satuan obat">
	             
	                    </div>
	                    <div class="form-group">
	                        <label>Merk</label>
	                       	<input class="form-control input-sm" name="merk" value="<?= $list['merk']?>" type="text" placeholder="Satuan obat">
	             
	                    </div>
	                    
	                    
		            </div>		                   
                    <div class="box-footer">
                         <button type="submit" class="btn btn-sm btn-primary btn-flat"><i class="fa fa-floppy-o"></i> Simpan</button>
                    </div>
                    <?php if (isset($_SERVER['HTTP_REFERER'])) {?>
			                <input type="hidden" name="redirurl" value="<?php echo $_SERVER['HTTP_REFERER'];?>" />
			                <?php }?>
					<?php
					}else{
					echo "Tidak ada data";	
					}
					echo form_close();
					?>
		        </div><!-- /.box -->                            
		    </div>
		</div>

		<script>
		$("#form").validate({
			rules: {
				
				kd_obat: {
					required: true
				},
				obat: {
					required: true
				},
				harga: {
					required: true,
					number:true
				},
			}
		});
		</script>